<template>
	<view>
		<view class="title" :style="{paddingTop:StatusBar+'px'}">考试</view>
		<image src="https://img.zzplc.net/stc/logo.jpg" class="img"></image>
		<image src="/static/examButton.png" class="button" @click="clickButton"></image>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				StatusBar: '',
			};
		},
		
		onLoad() {
			let that = this
			let StatusBar = ''
			uni.getSystemInfo({
				success: function(e) {
					that.StatusBar = e.statusBarHeight
				}
			})
			
			wx.login().then((d) => {
				wx.request({
					url: getApp().globalData.url + '/sys/reg',
					method: 'POST',
					data: {
						code: d.code
					},
					header: {
						'content-type': 'application/x-www-form-urlencoded',
					},
					success: (res) => {
						// console.log(res)
						if (res.data.code == 20000) {
							wx.setStorageSync('openid', res.data.data.openid)
							wx.setStorageSync('token', res.data.data.token)
							wx.setStorageSync('showIndex', res.data.data.flag==1?true:false)
						}
					},
			
				})
			});
		},
		
		methods: {
			// 点击考试
			clickButton(){
				uni.navigateTo({
					url: '/pages/exam/startExam'
				})
			},
		},
	}
</script>

<style lang="scss">
	page{
		background: #03AEA5;
		overflow: hidden;
	}
	.title{
		position: fixed;
		top: 0rpx;
		left: 0rpx;
		width: 750rpx;
		height: 90rpx;
		font-size: 36rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 90rpx;
		text-align: center;
		z-index: 2;
	}
	.img{
		width: 750rpx;
		height: 100vh;
	}
	// .button{
	// 	position: fixed;
	// 	bottom: 400rpx;
	// 	left: 50%;
	// 	transform: translate(-50%);
	// 	width: 275rpx;
	// 	height: 85rpx;
	// 	background: #BF2538;
	// 	text-align: center;
	// 	font-family: PingFang SC;
	// 	font-weight: 500;
	// 	font-size: 38rpx;
	// 	color: #FFFFFF;
	// 	line-height: 85rpx;
	// 	letter-spacing: 3rpx;
	// 	border-radius: 12rpx;
	// }
	.button{
		position: fixed;
		bottom: 150rpx;
		left: 50%;
		transform: translate(-50%);
		width: 518rpx;
		height: 138rpx;
	}
</style>
